﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="list.aspx.cs" Inherits="list" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="SpeciesID" DataSourceID="AccessDataSource1" EmptyDataText="没有可显示的数据记录。">
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                <asp:BoundField DataField="SpeciesID" HeaderText="SpeciesID" ReadOnly="True" 
                    SortExpression="SpeciesID" />
                <asp:BoundField DataField="ScientificName" HeaderText="ScientificName" 
                    SortExpression="ScientificName" />
                <asp:BoundField DataField="ChineseName" HeaderText="ChineseName" 
                    SortExpression="ChineseName" />
                <asp:BoundField DataField="CommonName" HeaderText="CommonName" 
                    SortExpression="CommonName" />
                <asp:BoundField DataField="PopIntro" HeaderText="PopIntro" 
                    SortExpression="PopIntro" />
            </Columns>
        </asp:GridView>
        <asp:AccessDataSource ID="AccessDataSource1" runat="server" 
            DataFile="App_Data\MainDB.mdb" DeleteCommand="DELETE FROM `Species` WHERE `SpeciesID` = ?" 
            InsertCommand="INSERT INTO `Species` (`SpeciesID`, `ScientificName`, `ChineseName`, `CommonName` `PopIntro`) VALUES (?, ?, ?, ?, ?)" 
            SelectCommand="SELECT `SpeciesID`, `ScientificName`, `ChineseName`, `CommonName`, `PopIntro` FROM `Species`" 
            UpdateCommand="UPDATE `Species` SET `ScientificName` = ?, `ChineseName` = ?, `CommonName` = ?, `PopIntro` = ? WHERE `SpeciesID` = ?">
            <DeleteParameters>
                <asp:Parameter Name="SpeciesID" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="ScientificName" Type="String" />
                <asp:Parameter Name="ChineseName" Type="String" />
                <asp:Parameter Name="CommonName" Type="String" />
                <asp:Parameter Name="PopIntro" Type="String" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="ScientificName" Type="String" />
                <asp:Parameter Name="ChineseName" Type="String" />
                <asp:Parameter Name="CommonName" Type="String" />
                <asp:Parameter Name="PopIntro" Type="String" />
            </UpdateParameters>
        </asp:AccessDataSource>
    
    </div>
    </form>
</body>
</html>
